async function flushPage(tableData, pagination, func) {
  if (
    pagination.currentPage * pagination.pageSize > pagination.total &&
    tableData.length === 0
  ) {
    if (pagination.currentPage - 1 > 0) {
      pagination.currentPage = pagination.currentPage - 1;
      await func();
    }
  }
}

module.exports = {
  flushPage,
};
